package p2;

/**
 * Comparing abstract classes and interfaces:
 *
 */
abstract class Abstract{
	private int x;
	public abstract int somemethod();
	public String toString(){ return "" + x; }
}
interface Doable{
	//  Error: data members cannot be private
	//private int x = 1;
	// Methods are implicitly abstract:
	//public int somemethod();
	//  Error: interface methods cannot have method bodies 
	//public String toString(){ return "" + x; }
}

class A implements Doable{}

class B implements Doable{}

public class Main2 {
	public static void main(String[] args) {
		A a = new A();
		B b = new B();
		
		Doable a1 = new B();
		Doable a2 = new A();
		
//		Doable d = new Doable();
		Doable[] arr = new Doable[10];
		arr[0] = a;
		arr[1] = b;
	}
}
